<template>
	<view style="padding: 30rpx;">
		<view style="background-color: #fff;border-radius: 16rpx;">
			<u-cell-item title="联单编号" :value="order.tranOrderCode" :arrow="false" hover-class="none"></u-cell-item>
		</view>
		<view style="margin: 10rpx 0;">垃圾移出信息</view>
		<view style="background-color: #fff;border-radius: 16rpx;margin-top: 20rpx;">
			<u-cell-item title="工地名称" :value="order.soilFieldName" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="工地地址" :value="order.soilFieldNameAddr" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="施工单位" :value="order.implementationUnit" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="移出时间" :value="order.startTime" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="垃圾种类" :value="order.wasteTypeText" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="运输量" :value="order.removalQuantity" :arrow="false" hover-class="none"></u-cell-item>
		</view>
		<view style="margin: 10rpx 0;">运输信息</view>
		<view style="background-color: #fff;border-radius: 16rpx;margin-top: 20rpx;">
			<u-cell-item title="运输公司" :value="order.transportationCompanyName" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="车牌号" :value="order.plate" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="驾驶员" :value="order.driverName" :arrow="false" hover-class="none"></u-cell-item>
			<u-cell-item title="联系电话" :value="order.driverPhone"></u-cell-item>
		</view>
		<view v-if="order.soilSiteCompanyId" style="margin: 10rpx 0;">垃圾接收信息</view>
		<view v-if="order.soilSiteCompanyId"  style="background-color: #fff;border-radius: 16rpx;margin-top: 20rpx;">
			<u-cell-item title="处置场所" :value="order.soilSiteCompanyName" :arrow="false" hover-class="none"></u-cell-item>
			<!-- <u-cell-item title="接收地址" value="WS20230915001" :arrow="false" hover-class="none"></u-cell-item> 
			<u-cell-item title="负责人" value="WS20230915001" :arrow="false" hover-class="none"></u-cell-item> -->
			<u-cell-item title="接收时间" :value="order.endTime" :arrow="false" hover-class="none"></u-cell-item>	
			<!-- <u-cell-item title="垃圾种类" value="WS20230915001" :arrow="false" hover-class="none"></u-cell-item> -->
			<u-cell-item title="接收量" :value="order.receivingQuantity" :arrow="false" hover-class="none"></u-cell-item>
		</view>
		<view v-if="order.remark" style="margin: 10rpx 0;">备注信息</view>
		<view v-if="order.remark"  style="background-color: #fff;border-radius: 16rpx;margin-top: 20rpx;padding: 30rpx;">
			{{order.remark}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: '',
				order: '',
				wasteTypeList: [{
					'value': 0,
					'label': '装修垃圾'
				}, {
					'value': 1,
					'label': '工程渣土'
				}, {
					'value': 2,
					'label': '工程泥浆'
				}, {
					'value': 3,
					'label': '建筑材料'
				}, {
					'value': 4,
					'label': '拆除垃圾'
				}],
			}
		},
		onLoad(opt) {
			
			this.orderId = opt.id
			this.initData()
		},
		methods: {
			initData() {
				this.$u.get(`/driver/details/${this.orderId}`).then(res => {
					if (res.code == 200) {
						let order = res.data
						for(let i = 0;i<this.wasteTypeList.length;i++){
							if(order.wasteType&&this.wasteTypeList[i].value==order.wasteType){
								order.wasteTypeText = this.wasteTypeList[i].label
							}
						}
						this.order = order
					}
				})
			}
		}
	}
</script>

<style>

</style>